<style>
    /* 标准化的开关样式 */
    .switch-container {
        position: relative;
        display: inline-block;
    }

    .switch-container input[type="checkbox"] {
        opacity: 0;
        width: 0;
        height: 0;
        position: absolute;
    }

    .switch-label {
        display: inline-block;
        width: 60px;
        height: 30px;
        background-color: #ccc;
        border-radius: 30px;
        position: relative;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .switch-label:before {
        content: '';
        position: absolute;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        top: 2px;
        left: 2px;
        background-color: white;
        transition: transform 0.3s;
    }

    .switch-container input[type="checkbox"]:checked+.switch-label {
        background-color: #1ab394;
    }

    .switch-container input[type="checkbox"]:checked+.switch-label:before {
        transform: translateX(30px);
    }

    .switch-text {
        display: inline-block;
        margin-left: 10px;
        vertical-align: middle;
        font-weight: normal;
    }
</style>
<form id="edit-form" class="form-horizontal" style="position:relative;background: #fff" role="form"
    data-toggle="validator" method="POST" action="">
    <div class="panel-body"></div>
    <div id="myTabContent" class="tab-content">
        <div class="tab-pane fade active in" id="tabs_0">
            <input type="hidden" id="row" name="data" value='<?php echo json_encode($row);?>' />
            <input type="hidden" id="id" name="row[id]" value='{$row.id}' />
            <input type="hidden" id="c-city_id" name="city_id" value="{$city_id}" class="form-control"
                   data-rule="" data-tip="ID" />
            <input type="hidden" id="c-school_id" name="school_id" value="{$school_id}" class="form-control"
                data-rule="" data-tip="ID" />
            <input type="hidden" id="c-community_id" name="community_id" value="{$community_id}" class="form-control"
                data-rule="" data-tip="ID" />
            <input type="hidden" id="c-address_lv" name="address_lv" value="{$address_lv}" class="form-control"
                data-rule="" data-tip="ID" />

            <div class="form-group">
                <label for="c-table_id" class="control-label col-xs-12 col-sm-2">课程项目名称:</label>
                <div class="col-xs-12 col-sm-8" id="div-table_id">
                    <select name="row[table_id]" id="c-table_id" class="form-control" data-default="{$row.table_id}"  style="width:300px">
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label for="c-classes_id" class="control-label col-xs-12 col-sm-2">班级名称:</label>
                <div class="col-xs-12 col-sm-8" id="div-classes_id">
                    <select name="row[classes_id]" id="c-classes_id" class="form-control" readonly=""  style="width:300px">
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label for="c-subject_lv" class="control-label col-xs-12 col-sm-2">教学类型:</label>
                <div class="col-xs-12 col-sm-8" id="div-subject_lv">
                    <select name="row[subject_lv]" id="c-subject_lv" class="form-control" style="width:300px">
                    </select>
                </div>
            </div>



            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">适合教室:</label>
                <div class="col-xs-12 col-sm-8" id="div-ocation_type">
                    <?php
                                $ocationtypeArray = explode(',', $row['ocation_type']);
                            ?>
                    <label for="row[ocation_type]-1"><input id="row[ocation_type]-1" name="row[ocation_type][]"
                            type="checkbox" value="1" <?php if(in_array(1, $ocationtypeArray)): ?>checked
                        <?php endif; ?>/> 标准(有桌椅)
                    </label>
                    <label for="row[ocation_type]-2"><input id="row[ocation_type]-2" name="row[ocation_type][]"
                            type="checkbox" value="2" <?php if(in_array(2, $ocationtypeArray)): ?>checked
                        <?php endif; ?>
                        /> 书画(有书画桌)
                    </label>
                    <label for="row[ocation_type]-3"><input id="row[ocation_type]-3" name="row[ocation_type][]"
                            type="checkbox" value="3" { <?php if(in_array(3, $ocationtypeArray)): ?>checked
                        <?php endif; ?>
                        /> 肢体(开阔的场地)
                    </label>
                    <label for="row[ocation_type]-4"><input id="row[ocation_type]-4" name="row[ocation_type][]"
                            type="checkbox" value="4" <?php if(in_array(4, $ocationtypeArray)): ?>checked
                        <?php endif; ?>
                        /> 综合(有椅没桌)
                    </label>
                </div>
            </div>

            <div id="app">
                <div class="form-group">
                    <label for="c-subject_lv" class="control-label col-xs-12 col-sm-2">老师岗:</label>
                    <div class="col-xs-12 col-sm-8" id="div-teacher">
                        <teacher-box :type="''" :left-options="leftOptions" :right-options="rightOptions"></teacher-box>
                        老师：<input type="text" name="row[teacher_new]" value="{$row.teacher_new}" placeholder="请输入老师姓名" />
                    </div>

                </div>
                <div class="form-group">
                    <label for="c-subject_lv" class="control-label col-xs-12 col-sm-2">管理岗:</label>
                    <div class="col-xs-12 col-sm-8" id="div-manager">
                        <manager-box :type="''" :left-options="leftOptions" :right-options="rightOptions"></manager-box>
                        管理员：<input type="text" name="row[manager_new]" value="{$row.manager_new}" placeholder="请输入管理员姓名" />

                    </div>
                </div>
            </div>
            <div class="form-group">
                <label for="c-price" class="control-label col-xs-12 col-sm-2">学费:</label>
                <div class="col-xs-12 col-sm-8" id="div-price">
                    <input type="number" id="c-price" name="row[price]" value="{$row.price}" class="form-control"
                           title="price" data-rule="require num" data-rule-num="[/^[0-9\.]+$/, '只能填入数值']"
                           placeholder="只能填入数值" data-tip="课程价格" />
                </div>
            </div>
            <div class="form-group">
                <label for="c-num" class="control-label col-xs-12 col-sm-2">招生人数:</label>
                <div class="col-xs-12 col-sm-8" id="div-num">
                    <input type="number" id="c-num" name="row[num]" value="{$row.num}" class="form-control"
                           title="num" data-rule="require num" data-rule-num="[/^[0-9\.]+$/, '只能填入数值']"
                           placeholder="只能填入数值" data-tip="招生人数" />
                </div>
            </div>
            <div class="form-group">
                <label for="c-ocourse_count" class="control-label col-xs-12 col-sm-2">课程长度:</label>
                <div class="col-xs-12 col-sm-8" id="div-ocourse_count">
                    <input type="number" id="c-ocourse_count" name="row[ocourse_count]" value="{$row.ocourse_count}"
                        class="form-control" title="ocourse_count" data-rule="require num"
                        data-rule-num="[/^[0-9\.]+$/, '只能填入数值']" placeholder="只能填入数值" data-tip="课程长度" />
                </div>
            </div>

            <div class="form-group">
                <label for="c-classes_per_week" class="control-label col-xs-12 col-sm-2">一周最大排课数:</label>
                <div class="col-xs-12 col-sm-8" id="div-classes_per_week">
                    <input type="number" id="c-classes_per_week" name="row[classes_per_week]"
                        value="{$row.classes_per_week}" class="form-control" title="classes_per_week"
                        data-rule="integer" placeholder="只能填入整数" data-tip="一周几次课" />
                </div>
            </div>

            <div class="form-group">
                <label for="c-same_classroom" class="control-label col-xs-12 col-sm-2">是否同一间教室:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="switch-container">
                        <input id="c-same_classroom" name="row[same_classroom]" type="checkbox" value="1" {if
                            $row.same_classroom=='1' }checked{/if} />
                        <label for="c-same_classroom" class="switch-label"></label>
                        <span class="switch-text">{if $row.same_classroom=='1'}是{else}否{/if}</span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label for="c-same_ocation" class="control-label col-xs-12 col-sm-2">是否同一二级教学点:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="switch-container">
                        <input id="c-same_ocation" name="row[same_ocation]" type="checkbox" value="1" {if
                            $row.same_ocation=='1' }checked{/if} />
                        <label for="c-same_ocation" class="switch-label"></label>
                        <span class="switch-text">{if $row.same_ocation=='1'}是{else}否{/if}</span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label for="c-can_same_day" class="control-label col-xs-12 col-sm-2">是否能排在同一天:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="switch-container">
                        <input id="c-can_same_day" name="row[can_same_day]" type="checkbox" value="1" {if
                            $row.can_same_day=='1' }checked{/if} />
                        <label for="c-can_same_day" class="switch-label"></label>
                        <span class="switch-text">{if $row.can_same_day=='1'}是{else}否{/if}</span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label for="c-can_same_day" class="control-label col-xs-12 col-sm-2">最早排课日期:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="switch-container">
                        <input id="c-start_date" name="row[start_date]" type="date" value="{$row.start_date}" />
                    </div>
                </div>
            </div>


            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">时段选择:</label>
                <div class="col-xs-12 col-sm-8" id="div-daytime">
                    <?php $daytimeArray = explode(',', $row['daytime']);?>
                    <label for="row[daytime]-1">
                        <input id="row[daytime]-1" name="row[daytime][]" type="checkbox" value="1" <?php if(in_array(1,
                            $daytimeArray)): ?>checked
                        <?php endif; ?>/> 上午
                    </label>
                    <label for="row[daytime]-2"><input id="row[daytime]-2" name="row[daytime][]" type="checkbox" <?php
                            if(in_array(2, $daytimeArray)): ?>checked
                        <?php endif; ?> value="2"/> 中午
                    </label>
                    <label for="row[daytime]-3"><input id="row[daytime]-3" name="row[daytime][]" type="checkbox" <?php
                            if(in_array(3, $daytimeArray)): ?>checked
                        <?php endif; ?> value="3"/> 下午
                    </label>
                    <label for="row[daytime]-4"><input id="row[daytime]-4" name="row[daytime][]" type="checkbox" <?php
                            if(in_array(4, $daytimeArray)): ?>checked
                        <?php endif; ?> value="4"/> 晚上
                    </label>
                    <select id="c-daytime-all" style="display: none" multiple name="row[daytimeall][]"
                        value="{$row.daytimeall}" class="form-control" style="height:250px" data-tip="时段选择">
                    </select>
                </div>

            </div>
        </div>

        <div class="form-group">
            <label for="c-disable_week_range" class="control-label col-xs-12 col-sm-2">禁排:</label>
            <div class="col-xs-12 col-sm-8" id="div-disable_week_range">
                <label for="c-disable_week_range" class="control-label col-xs-12 col-sm-2"></label>
                <div style="margin-top:-2px">
                    <select id="c-disable_week_range" multiple data-rule="" data-select-only="true"
                        data-multiple="false" data-field="name" style="height:250px" class="form-control"
                        name="row[disable_week_range][]"></select>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="c-must_week_range" class="control-label col-xs-12 col-sm-2">必排:</label>
            <div class="col-xs-12 col-sm-8" id="div-must_week_range">
                <label for="c-must_week_range" class="control-label col-xs-12 col-sm-2"></label>
                <div style="margin-top:-2px">
                    <select id="c-must_week_range" multiple data-rule="" data-select-only="true" data-multiple="false"
                        data-field="name" style="height:250px" class="form-control"
                        name="row[must_week_range][]"></select>
                </div>
            </div>
        </div>
        <div class="form-group layer-footer">
            <label class="control-label col-xs-12 col-sm-2"></label>
            <div class="col-xs-12 col-sm-8">
                <button type="submit" id="classplant-edit-btn" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
            </div>
        </div>
    </div>

    </div>
    </div>
</form>